﻿CREATE TABLE [dbo].[RulajeDocSablon] (
    [IDSablon]        INT            IDENTITY (1, 1) NOT NULL,
    [IDTipDocument]   SMALLINT       NULL,
    [IDTipPlata]      SMALLINT       NULL,
    [Descriere]       VARCHAR (250)  NOT NULL,
    [OptiuneNumar]    SMALLINT       CONSTRAINT [DF_RulajeDocSablon_OptiuneNumar] DEFAULT ((0)) NULL,
    [OptiuneData]     SMALLINT       CONSTRAINT [DF_RulajeDocSablon_OptiuneData] DEFAULT ((0)) NULL,
    [TipFormula]      SMALLINT       CONSTRAINT [DF_RulajeDocSablon_TipFormula] DEFAULT ((0)) NOT NULL,
    [ApplicationName] NVARCHAR (256) CONSTRAINT [DF_RulajeDocSablon_ApplicationName] DEFAULT ('') NOT NULL,
    [Tabela]          VARCHAR (100)  NULL,
    CONSTRAINT [PK_RulajeDocSablon] PRIMARY KEY CLUSTERED ([IDSablon] ASC),
    CONSTRAINT [FK_RulajeDocSablon_aspnet_Applications] FOREIGN KEY ([ApplicationName]) REFERENCES [dbo].[aspnet_Applications] ([ApplicationName]),
    CONSTRAINT [FK_RulajeDocSablon_TipDocument] FOREIGN KEY ([IDTipDocument]) REFERENCES [dbo].[TipDocument] ([IDTipDocument]),
    CONSTRAINT [FK_RulajeDocSablon_TipDocumentPlata] FOREIGN KEY ([IDTipPlata]) REFERENCES [dbo].[TipDocumentPlata] ([IDTipPlata])
);

